1. Field of the Invention
The present invention relates to an image correction technique of removing, from an image, a foreign substance which sticks to the optical system of an image capturing apparatus such as a digital camera.
2. Description of the Related Art
In a lens interchangeable digital single-lens reflex camera, conventionally, when a foreign substance such as dust sticks to the image capturing optical system (especially on the surface of an optical element such as a low-pass filter arranged in front of the image sensor), captured images may contain the image of the foreign substance. In this case, since the shot images output to various destinations (e.g., a liquid crystal monitor and a printer) also contain the image of the foreign substance, the image quality degrades.
To solve this problem, the following proposal has been made. First, an object having, e.g., a solid white color is shot to obtain an image containing an image of dust in the image capturing optical system. The position information of the dust in the image capturing optical system is obtained from the image. Correction processes (e.g., removal, color correction, and interpolation based on neighboring pixels) are executed for the finally shot image on the basis of the position information. With this process, the corrected image contains no dust any more. It is therefore possible to output the image to an output destination such as a printer and cause it to print a dust-free image. This leads to an increase in the output image quality (Japanese Patent Laid-Open No. 2002-209147).
However, the dust correction may only degrade the image quality depending on the object state around the dust. For example, assume that objects without a solid color (e.g., buildings that stand close together) exist around the dust. In this case, smearing may occur in the object upon dust correction, and a sense of incongruity may be generated between the dust region and its periphery. If the correction condition (e.g., the portion around the dust needs to have a solid color) is uniformly made stricter to prevent the sense of incongruity around the dust upon correction, the dust can rarely be corrected.
Hence, an image in which smearing has occurred in the object, or an image in which dust has rarely been corrected is output. This degrades the output image quality after all.